/// console.log("Start to load custom js code............");
/////////////////////////
String.prototype.startsWith = function(str) {
  return this.indexOf(str) === 0;
};
/////////////////////////
function loadStyle(url, callback) {
    var link = document.createElement('link');
    link.type = 'text/css';
    link.rel = 'stylesheet';
    link.href = url;
    if (callback) {
        link.onload = link.onreadystatechange = function() {
            if (link.readyState && link.readyState != 'loaded' && link.readyState != 'complete') {
                return;
            }
        }
        link.onreadystatechange = link.onload = null;
        callback();
    }

    link.href = url;
    document.getElementsByTagName('head')[0].appendChild(link);
}

function loadScript(url, callback) {
  var script = document.createElement('script');
  script.type = 'text/javascript';
  script.src = url;
  if (callback) {
    script.onload = script.onreadystatechange = function() {
      if (script.readyState && script.readyState != 'loaded' && script.readyState != 'complete') {
        return;
      }
      
      script.onreadystatechange = script.onload = null;
      
      callback();
    };
  }
  
  script.src = url;
  document.getElementsByTagName('head')[0].appendChild(script);
}

//loadScript('/abtester/3rdparty/jquery-1.8.0.min.js', function(){
//    loadStyle('/abtester/3rdparty/jqueryui/css/redmond/jquery-ui-1.10.0.custom.min.css');
//    loadScript('/abtester/3rdparty/jqueryui/js/jquery-ui-1.10.0.custom.min.js');
//});